﻿<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>ZhuaBa-Login</title>

    <!-- begin::global styles -->
    <link rel="stylesheet" href="../static/assets/vendors/bundle.css" type="text/css">
    <!-- end::global styles -->

    <!-- begin::custom styles -->
    <link rel="stylesheet" href="../static/assets/css/app.css" type="text/css">
    <!-- end::custom styles -->
    <script type="text/javascript">
        function myFunction()
        {
            $.ajax({
                type: "post",
                url : "http://localhost:8080/" + "/login/getLogin",
                dataType:'json',
                data: {
                },
                success: function(data){
                    var amount = data.data;
                    //取出总人数
                    var flag1 = amount.flag1;
                    //总人数减去已经签到的人数，就是未签到的人
                    var login1 = amount.login1;
                    //取出后端controller中setMessage方法传过来的字符串
                    var forget1 = amount.forget1;
                    var logMessage = data.message;
                    if(flag1==0){
                        alert("密码错误或用户名不存在！");
                    }
                    if(login1==0){
                        alert("您未登录！");
                    }
                    if(forget1==1){
                        alert("密码修改成功！")
                    }
                }
            });

        }
    </script>
</head>
<body class="bg-white h-100-vh p-t-0" onload="myFunction()">

<!-- begin::page loader-->
<div class="page-loader">
    <div class="spinner-border"></div>
    <span>Loading ...</span>
</div>
<!-- end::page loader -->

<div class="p-b-50 d-block d-lg-none"></div>

<div class="container h-100-vh">
    <div class="row align-items-md-center h-100-vh">
        <div class="col-lg-6 d-none d-lg-block">
            <img class="img-fluid" src="../static/assets/media/svg/login.svg" alt="...">
        </div>
        <div class="col-lg-4 offset-lg-1">
            <div class="d-flex align-items-center m-b-20">
                <img src="../static/assets/media/image/dark-logo.png" class="m-r-15" width="40" alt="">
                <h3 class="m-0">ZhuaBa-Login</h3>
            </div>
            <p th:text="#{login.tip}">Sign in to continue.</p>
            <form action="/loginController" method="post">
                <div class="form-group mb-4">
                    <input type="text" class="form-control form-control-lg" id="exampleInputEmail1" name="EmailOrUsername" th:placeholder="#{login.usernameoremail}" autofocus placeholder="Email or username">
                </div>
                <div class="form-group mb-4">
                    <input type="password" class="form-control form-control-lg" id="exampleInputPassword1" name="Password" th:placeholder="#{login.password}" placeholder="Password">
                </div>
                <button class="btn btn-primary btn-lg btn-block btn-uppercase mb-4" type="submit" th:text="#{login.sign}">Sign In</button>
                <div class="d-flex justify-content-between align-items-center mb-4">
                    <div class="custom-control custom-checkbox">
                        <input type="checkbox" class="custom-control-input" id="customCheck">

                    </div>
                    <a href="Forget.html" class="auth-link text-black" th:text="#{login.forget}">Forgot password?</a>
                </div>
                <div class="text-center" >
                    <a th:text="#{login.create1}">Don't have an account?</a>  <a href="register.html" class="text-primary" th:text="#{login.create}">Create</a>
                </div>
            </form>
        </div>
    </div>
</div>

<!-- begin::global scripts -->
<script src="../static/assets/vendors/bundle.js"></script>
<!-- end::global scripts -->

<!-- begin::custom scripts -->
<script src="../static/assets/js/app.js"></script>
<!-- end::custom scripts -->

</body>
</html>